import request from './request.js'
export function uploadFile(file,projectNo,annexType){
	
	let token = uni.getStorageSync('userInfo').token
	return new Promise((resolve,reject)=>{
		return uni.uploadFile({
			filePath:file,
			name: 'file',
			url: `${request.getBaseUrl()}annex/upload/single`,
			header:{
				Authorization : token || '123456'
			},
			formData:{
				annexType:annexType,
				projectNo:projectNo
			},
			success: (res) => {
				resolve(res)
			},
			fail:(err) => {
				reject(err)
			}
		})
	})
}
